package gat.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * 支付平台
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum PlatformTypeEnum {

    NATIVE("native", "原生"),
    HUIFU("huifu", "汇付"),
    ZHILIAN("zhilian", "直连"),
    TONGLIAN("tonglian", "通联"),
    LIANLIAN("lianlian", "连连"),
    ;

    private String flag;
    private String desc;

    public static PlatformTypeEnum getByFlag(String flag) {
        for (PlatformTypeEnum platformTypeEnum : values()) {
            if (platformTypeEnum.getFlag().equals(flag)) {
                return platformTypeEnum;
            }
        }
        return null;
    }
}
